package com.wusiwei.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;

/**
 * Swagger文档使用的数据模型
 */
public class SwaggerModels {

    /**
     * 用户登录请求模型
     */
    @Data
    @Schema(description = "用户登录请求")
    public static class LoginRequest {

        @Schema(description = "用户名", example = "admin", required = true)
        private String username;

        @Schema(description = "密码", example = "password", required = true)
        private String password;

        @Schema(description = "记住我", example = "false")
        private Boolean rememberMe;
    }

    /**
     * 登录响应模型
     */
    @Data
    @Schema(description = "登录响应")
    public static class LoginResponse {

        @Schema(description = "是否成功", example = "true")
        private Boolean success;

        @Schema(description = "消息", example = "登录成功")
        private String message;

        @Schema(description = "令牌", example = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...")
        private String token;

        @Schema(description = "用户信息")
        private UserInfo userInfo;
    }

    /**
     * 用户信息模型
     */
    @Data
    @Schema(description = "用户信息")
    public static class UserInfo {

        @Schema(description = "用户ID", example = "1")
        private Integer id;

        @Schema(description = "用户名", example = "admin")
        private String username;

        @Schema(description = "真实姓名", example = "系统管理员")
        private String realName;

        @Schema(description = "角色列表", example = "[\"ROLE_ADMIN\"]")
        private List<String> roles;
    }

    /**
     * 发票查询条件模型
     */
    @Data
    @Schema(description = "发票查询条件")
    public static class InvoiceQueryParams {

        @Schema(description = "页码", example = "1")
        private Integer pageNum;

        @Schema(description = "每页数量", example = "10")
        private Integer pageSize;

        @Schema(description = "发票号码", example = "FP20230101001")
        private String invoiceNo;

        @Schema(description = "发票类别", example = "增值税专用发票")
        private String category;

        @Schema(description = "开始日期", example = "2023-01-01")
        private LocalDate startDate;

        @Schema(description = "结束日期", example = "2023-12-31")
        private LocalDate endDate;
    }

    /**
     * 发票详情模型
     */
    @Data
    @Schema(description = "发票详情项")
    public static class InvoiceDetailItem {

        @Schema(description = "ID", example = "1")
        private Integer id;

        @Schema(description = "发票ID", example = "1")
        private Integer invoiceId;

        @Schema(description = "项目名称", example = "商品A")
        private String itemName;

        @Schema(description = "规格型号", example = "XL")
        private String specifications;

        @Schema(description = "单位", example = "个")
        private String unit;

        @Schema(description = "数量", example = "2")
        private BigDecimal quantity;

        @Schema(description = "单价", example = "100.00")
        private BigDecimal unitPrice;

        @Schema(description = "税率", example = "0.13")
        private BigDecimal taxRate;

        @Schema(description = "金额", example = "200.00")
        private BigDecimal amount;

        @Schema(description = "税额", example = "26.00")
        private BigDecimal taxAmount;
    }

    /**
     * 通用响应模型
     */
    @Data
    @Schema(description = "通用响应")
    public static class CommonResponse<T> {

        @Schema(description = "是否成功", example = "true")
        private Boolean success;

        @Schema(description = "消息", example = "操作成功")
        private String message;

        @Schema(description = "数据")
        private T data;
    }
} 